package com.bayleaf.web.sample;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bayleaf.core.BayleafServlet;
import com.bayleaf.core.Model;


@WebServlet(name="sample",
        urlPatterns={"/sample"},
        initParams={ @WebInitParam(name="title", value="샘플"), @WebInitParam(name="jsp", value="/sample/Sample") } )
public class SampleServlet extends BayleafServlet {
	
    @Override
    public String process(Model model) throws Exception{
    	
    	String input = model.getString("input");
    	
    	System.out.println("input data : "+input);
    	
    	Integer output = Integer.parseInt(input) * Integer.parseInt(input);
    	
//    	SampleVO vo = new SampleVO();
//    	
//    	vo.setOutput(output);
    	
    	model.setString("output",output.toString());
    	
        return null;
    }
    
}
